from django.urls import path

from . import views

app_name = 'departments'

urlpatterns = [
    # 院系部门板块主页
    path('', views.index_view, name='index'),
    # 社团列表页（可按校区分类展示），搜索结果页
    path('associations/list/<int:campus_id>', views.associations_view, name='associations'),
    # 部门列表页（可按校区分类展示），搜索结果页
    path('departments/list/<int:campus_id>', views.departments_view, name='departments'),
    # 社团详情页
    path('association/details/<int:association_id>/', views.specific_association_view, name='association_info'),
    # 预览待审核社团详情页
    path('association/details/preview/<int:association_id>/', views.preview_association_view,
         name='preview_association'),
    # 部门详情页
    path('department/details/<int:department_id>/', views.specific_department_view, name='department_info'),
    # 预览待审核部门详情页
    path('department/details/preview/<int:department_id>/', views.preview_department_view, name='preview_department'),
    # 成立社团
    path('association/add/', views.add_association_view, name='add_association'),
    # 解散社团
    path('association/delete/<int:association_id>/', views.delete_association_view, name='delete_association'),
    # 修改社团信息
    path('association/update/<int:association_id>/', views.update_association_view, name='update_association'),
    # 成立部门
    path('department/add/', views.add_department_view, name='add_department'),
    # 解散部门
    path('department/delete/<int:department_id>/', views.delete_department_view, name='delete_department'),
    # 修改部门信息
    path('department/update/<int:department_id>/', views.update_department_view, name='update_department'),
    # 社团文章列表页，搜索结果页
    path('associationPosts/list', views.association_posts_view, name='association_posts'),
    # 部门文章列表页，搜索结果页
    path('departmentPosts/list', views.department_posts_view, name='department_posts'),
    # 社团文章详情页
    path('associationPost/details/<int:post_id>/', views.association_specific_post_view, name='association_post_info'),
    # 预览社团文章草稿详情页
    path('associationPost/details/preview/<int:post_id>/', views.preview_association_post_view,
         name='preview_association_post'),
    # 部门文章详情页
    path('departmentPost/details/<int:post_id>/', views.department_specific_post_view, name='department_post_info'),
    # 预览部门文章草稿详情页
    path('departmentPost/details/preview/<int:post_id>/', views.preview_department_post_view,
         name='preview_department_post'),
    # 增加社团文章
    path('associationPost/add/', views.add_association_post_view, name='add_association_post'),
    # 删除社团文章
    path('associationPost/delete/<int:post_id>/', views.delete_association_post_view, name='delete_association_post'),
    # 更新社团文章
    path('associationPost/update/<int:post_id>/', views.update_association_post_view, name='update_association_post'),
    # 增加部门文章
    path('departmentPost/add/', views.add_department_post_view, name='add_department_post'),
    # 删除部门文章
    path('departmentPost/delete/<int:post_id>/', views.delete_department_post_view, name='delete_department_post'),
    # 修改部门文章
    path('departmentPost/update/<int:post_id>/', views.update_department_post_view, name='update_department_post'),
    # 给社团文章点个赞，前端网页采用Ajax技术实现局部更新
    path('associationPost/like/<int:post_id>/', views.like_association_post_view, name='like_association_post'),
    # 给部门文章点个赞
    path('departmentPost/like/<int:post_id>/', views.like_department_post_view, name='like_department_post'),
]
